package com.yc.component;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.yc.util.IdUtil;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 自定义id
 * <p>
 *
 * @author BAO
 * @since 2020/9/16 23:59
 */
@Component
public class CustomIdGenerator implements IdentifierGenerator {
    @Override
    public Long nextId(Object entity) {
        return IdUtil.nextId();
    }

    @Override
    public String nextUUID(Object entity) {
        return String.valueOf(IdUtil.nextId());
    }
}
